import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import router from './router'
import axios from './axios'
import global from './global'
import { ElMessage } from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

const app = createApp(App);

app.use(router)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(ElementPlus,{
  locale: zhCn,
})

app.config.globalProperties.$axios = axios
app.config.globalProperties.global = global
app.config.globalProperties.msg = ElMessage
app.config.globalProperties.router = router
// app.prototype.$axios = axios  //配置axios的全局引用
app.mount('#app')


